﻿using System;
using System.Data;
using System.Data.OracleClient;

namespace Azalea.ORMap
{
    public class DbFactoryOracle : DbFactoryBase
    {
        public override string ParameterPrefix
        {
            get { return ":"; }
        }

        public override IDbConnection NewConnection()
        {
            return new OracleConnection();
        }

        public override IDbCommand NewCommand()
        {
            return new OracleCommand();
        }

        public override IDataAdapter NewDataAdapter(IDbCommand cmd)
        {
            return new OracleDataAdapter((OracleCommand) cmd);
        }

        public override IDataParameter NewParameter()
        {
            return new OracleParameter();
        }

        public override string GetFunctionNameToGetAutoIncrementValue()
        {
            throw new NotImplementedException();
        }

        public override string GetSqlStatementToGetSchema()
        {
            return "select TABLE_NAME from CAT where TABLE_TYPE in ('VIEW','TABLE')";
        }
    }
}